package com.evan.idempotent.distributedlock;

import com.evan.idempotent.warpper.IdempotentRunnable;
import com.evan.idempotent.warpper.IdempotentSupplier;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import javax.sql.DataSource;
import java.util.concurrent.TimeUnit;

/**
 * @Description: mysql分布式锁实现
 * @Author liudeguang
 */
@Slf4j
@AllArgsConstructor
@NoArgsConstructor
public class DistributedLockMysql implements DistributedLock {


    private DataSource dataSource;

    @Override
    public <T> T lock(String key, long waitTime, long leaseTime, IdempotentSupplier<T> success, IdempotentSupplier<T> fail) {
        return null;
    }

    @Override
    public <T> T lock(String key, long leaseTime, IdempotentSupplier<T> success, IdempotentSupplier<T> fail) {
        return null;
    }

    @Override
    public <T> T lock(String key, long leaseTime, TimeUnit timeUnit, IdempotentSupplier<T> success, IdempotentSupplier<T> fail) {
        return null;
    }

    @Override
    public void lock(String key, long waitTime, long leaseTime, IdempotentRunnable success, IdempotentRunnable fail) {

    }

    @Override
    public void lock(String key, long leaseTime, IdempotentRunnable success, IdempotentRunnable fail) {

    }

    @Override
    public void lock(String key, long leaseTime, TimeUnit timeUnit, IdempotentRunnable success, IdempotentRunnable fail) {

    }
}
